#ifndef  __BSP_USART_H__
#define  __BSP_USART_H__

#include "usart.h"
#include "stdio.h"
#include "stdarg.h"
#include "bsp_core.h"

//#include "task_rs485_uboot.h"

#define DEBUG_USART     huart4
#define DTU_4G_USART    huart1

#define USART_Printf_FileInfo(format,...) printf("\r\ninfo:"__FILE__", Line: %05d: "format" ", __LINE__,##__VA_ARGS__)


//extern DMA_HandleTypeDef hdma_uart4_rx;
extern DMA_HandleTypeDef hdma_uart4_tx;
extern DMA_HandleTypeDef hdma_usart1_rx;
extern DMA_HandleTypeDef hdma_usart1_tx;
extern DMA_HandleTypeDef hdma_usart2_rx;
extern DMA_HandleTypeDef hdma_usart2_tx;


extern uint8_t DMA_USART_RxBuf01[DMA_Rx_Buffsize01];
extern uint8_t DMA_USART_RxBuf02[DMA_Rx_Buffsize];
extern uint8_t DMA_USART_RxBuf03[DMA_Rx_Buffsize];
extern uint8_t DMA_USART_RxBuf04[DMA_Rx_Buffsize];


void USART_IDLE_IRQHandler(UART_HandleTypeDef *huart);
void USART_DMA_Rx_Cmd(UART_HandleTypeDef *huart,uint8_t *p_dat,uint16_t data_len);
void USART_DMA_Tx_Cmd(UART_HandleTypeDef *huart,u8 *p_dat ,uint16_t data_len);
void USART_Normal_Tx_Cmd(UART_HandleTypeDef *huart,uint8_t *pdata,u16 buffsize);
void USART_Interrupt_Init_Config(UART_HandleTypeDef *huart,uint8_t *pdata,uint16_t dmaRxbuffsize);
void USART_Printf_Tx_Cmd(UART_HandleTypeDef *huart, const char *fmt, ...);



#endif


/**** Copyright (C)2023 Liu Jiahuan. All Rights Reserved **** END OF FILE ****/
